<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //    //可以直接把变量和方法名写入对象

        const name = "张三";
        const age = 10;
        const say = function(){
            console.log("你好我是"+this.name)
        }

        const student = {
            name,
            age,
            say
        }

        student.say();

        console.log(student.age);
    </script>
</body>
</html>